
<div>
    <!-- <p>this is p2c1 component</p>
    <p>p2c1 name is {{name}}</p> -->
    <ul>
        <li *ngFor='let num of nums;trackBy:trackByAge;'>{{num.name}}----{{num.age}}</li>
    </ul>

    <ul>
         <li *ngFor="let grocery of groceries; let i = index; trackBy: trackByGrocery;">
          <a href="#" (click)="selectGrocery(grocery);">
            {{ grocery.label }} {{ i }}------{{  grocery.id}}
          </a>
        </li>
    </ul>
</div>